package hk.m4s.lr.repair.test.ui.user;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.bumptech.glide.Glide;

import framework.common.baseui.UeBaseActivity;
import hk.m4s.lr.repair.test.R;
import hk.m4s.lr.repair.test.model.MyOrderModel;
import hk.m4s.lr.repair.test.model.MyOrderTuiModel;

/**
 * Created by qi.wang on 2017/5/8.
 * 订单详情
 */

public class OderReturnGoodsActivity extends UeBaseActivity {
    private MyOrderTuiModel.ListBean myOrderModel;
    TextView order_shop_state;
    TextView order_shop_name;
    TextView order_shop_price;
    TextView order_shop_size;
    TextView order_shop_num;
    TextView order_shop_fan;
    ImageView order_shop_img;
    private TextView order_state,order_times,order_tips;
    private Context context;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        baseSetContentView(R.layout.activity_order_returngoods_detail);
        hiddenFooter();
        setTitleText("退货详情");
        context=this;
        showGoBackBtn();
        findBaseView();
    }

    public void findBaseView() {
        myOrderModel = (MyOrderTuiModel.ListBean) getIntent().getSerializableExtra("model");
        order_state= (TextView) findViewById(R.id.order_state);
        order_times= (TextView) findViewById(R.id.order_times);
        order_tips= (TextView) findViewById(R.id.order_tips);
        order_shop_state = (TextView) findViewById(R.id.order_shop_state);
        order_shop_name = (TextView) findViewById(R.id.order_shop_name);
        order_shop_price = (TextView) findViewById(R.id.order_shop_price);
        order_shop_size = (TextView) findViewById(R.id.order_shop_size);
        order_shop_num = (TextView) findViewById(R.id.order_shop_num);
        order_shop_fan = (TextView) findViewById(R.id.order_shop_fan);
        order_shop_img = (ImageView) findViewById(R.id.order_shop_img);
//       order_shop_name.setText(myOrderModel.getName());
//        order_shop_price.setText("¥"+myOrderModel.getPrice());
//        order_shop_size.setText(myOrderModel.getSize());
//        order_shop_num.setText("x"+myOrderModel.getBuyNum());
        if(myOrderModel.getReturn_status().equals("1")){
            order_shop_state.setText("等待付款");

        }else if(myOrderModel.getReturn_status().equals("3")){
            order_shop_state.setText("已发货未收货");
        }
        try {
            //Glide.with(context).load(myOrderModel.getImg()).asBitmap().placeholder(R.mipmap.device_list_no_img).error(R.mipmap.device_list_no_img).into(order_shop_img);
        }catch (Exception e){
            e.printStackTrace();
        }
    }

    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.update_btn:
                Intent in=new Intent(OderReturnGoodsActivity.this,TuiMoneyActivity.class);
                startActivity(in);
                finish();
                break;
            case R.id.pay_btn:
                break;
        }
    }
}
